<style lang="less">
@import '../assets/style/yhqx_list.less';
</style>

<template>
	<div class="gt_list">
		<van-cell-group>
			<van-cell
                class="van-ellipsis"
                v-for="(item,index) in gantaList"
                :key="index">
				<img 
                    slot="icon"
                    :src="listImg[0]"
                    class="icon_l">
                <!-- 有条件判断 start-->
                <div v-if="item.status==0">
					<span class="iconBox" @click="clickList(item,0)">
						<img
							:src="listImg[1]"
							class="iconRight"/>
						<em class="iconText">接受任务</em>
					</span>
                </div>
                <!-- list 左侧图标条件判断 start-->
                <span>
                    <em v-if="item.alarm=='have'" class="yin" >隐</em>
                    <em v-if="item.que=='have'?true:false" class="que" >缺</em>
                </span>
                <template slot="title">
                    <div @click="clickList(item,1)">
                        <span  class="van-cell-text">{{tit}}{{item.textName}}</span>
                        <span>
                            <van-tag plain :class="item.cname">{{item.statusName}}</van-tag>
                        </span>
                    </div>
				</template>
			</van-cell>
		</van-cell-group>
	</div>
</template>

<script>
import {
  Cell,
  CellGroup,
  Tag
} from 'vant';

export default {
	  name: 'xs_list',
	  components: {
	    [Cell.name]: Cell,
	    [CellGroup.name]: CellGroup,
	    [Tag.name]: Tag
	  },
	  props: {
	    gantaList: Array,
	    listImg: {
	        type: Array,
			default () {
				return []
			}
		},
	    tit: String
	  },
	  data() {
	    return {
	      cname: ''
	    }
	  },
	  methods: {
	    clickList(data,num){
            let param = {};
            param.todo = num;
            param.data = data;
	        this.$emit('clickList',param);
	    }
	  }
}
</script>